package com.suyang.syt.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.suyang.syt.dao.interfaces.PicDao;
import com.suyang.syt.model.Pic;

@Repository
public class PicDaoImpl extends BaseDaoImpl<Pic> implements PicDao {

	@Override
	public List<Pic> findByids(String ids) {
		return this.list("from Pic p where p.id in(" + ids + ")");
	}

	@Override
	public void deleteByBids(String bids) {
		this.executeByHql("delete Pic where bid in(" + bids + ")");
	}

	@Override
	public List<Pic> findByBanner(long id) {
		return this.list("from Pic where bid=?", id);
	}

	@Override
	public void deleteByids(String ids) {

		this.executeByHql("delete Pic where id in(" + ids + ")");
	}

	@Override
	public List<Pic> findByBids(String bids) {
		return this.list("from Pic p where p.bid in(" + bids + ")");
	}

	@Override
	public List<Pic> findAll() {
		return this.list("from Pic p");
	}

}
